package com.cwm.producer;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.stereotype.Service;

@Service
@Slf4j
@RequiredArgsConstructor
public class ProducerService {
    private final StreamBridge streamBridge;

    /**
     * * 生产消息
     *
     * @param msg
     */
    public void sendMsg(String msg) {
        System.out.println("------生产消息------");
        streamBridge.send("source-out-0", msg);
    }
}
